{% from 'macros.html' import inline_field %}
<form
  id="{{ form_type }}-form"
  class="form-horizontal form-label-left add-id"
  method="post"
  autocomplete="off"
>
  <div class="modal-body">
    <ul class="nav nav-tabs bar_tabs">
      <li class="nav-item active">
        <a class="nav-link href-id" data-toggle="tab" href="#common"
          >Common Properties</a
        >
      </li>
      {% if form.properties %}
      <li class="nav-item">
        <a class="nav-link href-id" data-toggle="tab" href="#specific"
          >Specific Properties</a
        >
      </li>
      {% endif %} {% if form.rbac_properties %}
      <li class="nav-item add-id" id="rbac-nav">
        <a class="nav-link href-id" data-toggle="tab" href="#rbac-properties"
          >Access Control</a
        >
      </li>
      {% endif %}
    </ul>
    <div class="form-group">
      <div class="tab-content">
        <div class="tab-pane fade in active add-id" id="common">
          <div id="content" class="add-id" style="height: 100%;"></div>
          {% for field in form %} {% set properties = form.properties or {} %} {% if
          field.name not in properties and field.name != "owners" and field.name not in
          form.rbac_properties %} {{ inline_field(form_type, field) }} {% endif %} {%
          endfor %}
        </div>
        {% if form.properties %}
        <div class="tab-pane fade add-id" id="specific">
          {% for property in form.properties %} {% set field = form[property] %} {{
          inline_field(form_type, field) }} {% endfor %}
        </div>
        {% endif %} {% if form.rbac_properties %}
        <div class="tab-pane fade add-id" id="rbac-properties">
          {{ inline_field(form_type, form["owners"]) }} {% for property in
          form.rbac_properties %} {% set field = form[property] %} {{
          inline_field(form_type, field) }} {% endfor %}
        </div>
        {% endif %}
      </div>
    </div>
  </div>
</form>
